﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="SearchResults.aspx.cs" Inherits="SearchResults" Title="MyForum - Search results" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <h3><strong>Search results</strong></h3>
			    
    <div class="contentarea">
        <h4><asp:Label ID="SearchLabel" runat="server" Text="You are looking for"></asp:Label> : "<asp:Label ID="SearchedTextLabel" runat="server" Text="Test"></asp:Label>"</h4>
        
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:GridView ID="ResultsGridView" runat="server" AutoGenerateColumns="False" 
                    DataSourceID="SearchObjectDataSource">
                    <Columns>
                        <asp:BoundField DataField="Id" HeaderText="Id" SortExpression="Id" />
                        <asp:BoundField DataField="TopicId" HeaderText="TopicId" 
                            SortExpression="TopicId" />
                        <asp:BoundField DataField="AuthorId" HeaderText="AuthorId" 
                            SortExpression="AuthorId" />
                        <asp:BoundField DataField="CreationDate" HeaderText="CreationDate" 
                            SortExpression="CreationDate" />
                        <asp:BoundField DataField="ModificationDate" 
                            HeaderText="ModificationDate" SortExpression="ModificationDate" />
                        <asp:BoundField DataField="Text" HeaderText="Text" SortExpression="Text" />
                    </Columns>
                </asp:GridView>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    
    <asp:HiddenField ID="SearchPatternHiddenField" runat="server" Visible="false" />
    
    <asp:ObjectDataSource ID="SearchObjectDataSource" runat="server" 
        OldValuesParameterFormatString="original_{0}" SelectMethod="Search" 
        TypeName="MyForum.Business.Controllers.MessageController">
        <SelectParameters>
            <asp:ControlParameter ControlID="SearchPatternHiddenField" Name="searchPattern" 
                PropertyName="Value" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>
